//var browser_url = glUrl + '/js/swampy/';
var browser_url = glUrlB + '/js/swampy/';

var fieldName = null;
var wind = null;

function openSwampyBrowser(field_name, url, type, win) {
  wind       = win;
  fieldName  = field_name;

  var height = 550;
  var width  = 850;

  var top=Math.round((screen.height-height)/2);
  var left=Math.round(screen.width/2);

  var params = "top="+top+",left="+left+",width="+width+",height="+height+",buttons=no,scrollbars=no,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no";
  
  var wnd = window.open(browser_url, name,  params);
  wnd.focus();
}  

function insertURL(url) {
  url = glHost + url;
  wind.document.getElementById(fieldName).value = url;
  if(typeof(insert_url_callback) == undefined) {
  } else {
    insert_url_callback();
  }
}